
module Cms
  class WebPageEditorWindow < Window

    state_defined_by :layout => nil

    def initialize
      super()
      self.name = "Page layout"
    end

    def build
      unless uuid
        add PageLayout.new
      end
      e :script, "
        dcat_instance.oninit(function() {
          console.log('NEW layouteditor');
          new Cat.fragment.PageLayout(document.getElementById('#{id}'), #{options});
        });
      "
      super()
    end
  end
end